if exists(select name from sysobjects where name = 'sp_KhuyenMaiGetMyKhuyenMai')
	drop proc sp_KhuyenMaiGetMyKhuyenMai
go
/*-- =============================================
	Created by: HP
	Created on: 2014-06-24 (dd/mm/yyyy)
	Description: 
	--

	File:$sql-scripts/Proc.sp_KhuyenMaiGetMyKhuyenMai.sql
*/-- =============================================

CREATE PROCEDURE sp_KhuyenMaiGetMyKhuyenMai
@myKhuyenMai tinyint
AS
BEGIN
	SELECT top 6
		a.[KhuyenMaiId],
		a.[TieuDe],
		a.[GiaNiemYet],
		a.[GiaKM],
		a.[ThoiGian],
		a.[Link],
		a.[ImageSmall],
		a.[SiteNguon],
		a.[Provider],
		a.[Summary],
		a.[ThuTu],
		a.[TrangThai],
		a.[NguoiTao],
		a.[NgayTao],
		a.[NguoiSua],
		a.[NgaySua],
		a.[WebId],
		a.[ThanhPho],
		a.[MyKhuyenMai]
	FROM
        KhuyenMai a WHERE TrangThai<>255 and a.MyKhuyenMai=@myKhuyenMai
END
GO
